package test.patches;

import com.evacipated.cardcrawl.modthespire.lib.*;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import test.character.Captain;
import test.monitors.SeaMonitor;

public class SeaPatch
{

    @SpirePatch(
            clz = AbstractCard.class,
            method = "update"
    )
    public static class AnglePatch {
        @SpirePrefixPatch
        public static void prefix(AbstractCard __instance) {
            if(AbstractDungeon.player instanceof Captain){
                if(!AbstractDungeon.player.hand.contains(__instance)){
                    if(SeaMonitor.contains(__instance)){
                        SeaMonitor.onRemoveFromHand(__instance);
                    }
                }else{
                    if(!SeaMonitor.contains(__instance)){
                        SeaMonitor.onAddFromHand(__instance);
                    }
                }
            }
        }
    }

}
